﻿function Validate() {

    //var objtxtCompanyName = document.getElementById('ctl00_ctl00_MainSplitter_Content_ASPxSplitter1_Content_popup_txtCompanyName_I')

    var obj_LoginName = document.getElementById('ctl00_ctl00_ASPxSplitter1_Content_ContentSplitter_MainContent_popup_txtLoginName_I');    
    var obj_Password = document.getElementById('ctl00_ctl00_ASPxSplitter1_Content_ContentSplitter_MainContent_popup_txtPassword_I');
    var obj_FisrtName = document.getElementById('ctl00_ctl00_ASPxSplitter1_Content_ContentSplitter_MainContent_popup_txtFirstName_I');
    var obj_MiddleName = document.getElementById('ctl00_ctl00_ASPxSplitter1_Content_ContentSplitter_MainContent_popup_txtMiddleName_I');
    var obj_LastName = document.getElementById('ctl00_ctl00_ASPxSplitter1_Content_ContentSplitter_MainContent_popup_txtLastName_I');
    var obj_DisplayName = document.getElementById('ctl00_ctl00_ASPxSplitter1_Content_ContentSplitter_MainContent_popup_txtDisplayName_I');
    var obj_MobileNo = document.getElementById('ctl00_ctl00_ASPxSplitter1_Content_ContentSplitter_MainContent_popup_txtMobileNo1_I');
    
    var obj_EmailID = document.getElementById('ctl00_ctl00_ASPxSplitter1_Content_ContentSplitter_MainContent_popup_txtEmailID_I');
    //cmbDesignation ctl00_ctl00_ASPxSplitter1_Content_ContentSplitter_MainContent_popup_cmbWarehouse_I
    var obj_cmbBranch = document.getElementById('ctl00_ctl00_ASPxSplitter1_Content_ContentSplitter_MainContent_popup_cmbBranch_I');
    var obj_cmbWarehouse = document.getElementById('ctl00_ctl00_ASPxSplitter1_Content_ContentSplitter_MainContent_popup_cmbWarehouse_I');
    var obj_cmbDesignation = document.getElementById('ctl00_ctl00_ASPxSplitter1_Content_ContentSplitter_MainContent_popup_cmbDesignation_I');

    if (obj_LoginName.value == "")
    {
        alert('Kindly Specify Login Name.')
        obj_LoginName.focus();
        return false;
    }
    if (obj_Password.value == "") {
        alert('Kindly Specify Password.')
        obj_Password.focus();
        return false;
    }
    if (obj_FisrtName.value == "") {
        alert('Kindly Specify Fisrt Name.')
        obj_FisrtName.focus();
        return false;
    }
    if (obj_LastName.value == "") {
        alert('Kindly Specify Last Name.')
        obj_LastName.focus();
        return false;
    }
    if (obj_MobileNo.value == "") {
        alert('Kindly Specify MobileNo1.')
        obj_MobileNo.focus();
        return false;
    }

    var obj = obj_EmailID;
    var regex = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/;

    if (obj_EmailID.value != "") {
        if (regex.test(obj.value)) {

        }
        else {
            alert('Please Enter Valid Email ID.')
            obj_EmailID.focus()
            return false;
        }
    }

    if (obj_cmbDesignation.value == "--Select--")
    {
        alert('Kindly Select Designation.')
        obj_cmbDesignation.focus();
        return false;
    }

    var r = confirm("Are you sure ??? ");
    if (r) {
    }
    else {
        return false
    }

    return true;
}